Skip to content

feat(ENG-15367): label runs made by AI coding agents - #573

Draft
tigh-latte wants to merge 1 commit into
eng-14331-5-commandfrom
eng-14331-6-agent
Draft

tigh-latte wants to merge 1 commit into
eng-14331-5-commandfrom
eng-14331-6-agent

Conversation

@tigh-latte

@tigh-latte tigh-latte commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Usage telemetry stack, part 6 of 6. Builds on #572.

Description

This PR labels runs made by AI coding agents. When the environment shows that an agent ran the command, the event gets persona: agent and a new agent property with a name defined in code. It is kept separate from the rest of the stack so it can be reviewed, or left out, on its own.

Marker (checked in this order) agent
CLAUDE_CODE_CHILD_SESSION claude_code
CODEX_THREAD_ID codex
GEMINI_CLI gemini_cli
COPILOT_AGENT, COPILOT_CLI, COPILOT_AGENT_SESSION_ID copilot
AI_AGENT with a known prefix (claude-code, github_copilot, codex, gemini, opencode) the matching name
AI_AGENT with any other value unidentified_agent
  • Only markers that agents set for the commands they run are read. Variables that IDEs also set in a person's own terminal (CLAUDECODE, CURSOR_TRACE_ID, REPL_ID, TERM_PROGRAM, COPILOT_MODEL) are ignored, because reading them would label people as agents.
  • The value of a variable is never sent, only the name from the table.
  • An agent takes the persona even in CI, while ci and ci_provider stay as they are, so both are visible.
  • Persona never changes identity. An agent on a laptop keeps the laptop's install ID.

There's no CLOUDSMITH_AGENT variable for declaring or overriding the label. Detection is a best-effort label, and a variable that lets a caller say it isn't an agent would add an interface without making the label more trustworthy.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Other (please describe)

Additional Notes

N/A: no change for runs without an agent marker.

🤖 Generated with Claude Code

A run gets persona "agent" when the environment shows an AI coding agent
ran the command. Only markers that agents set for the commands they run
are read (Claude Code, Codex CLI, Gemini CLI, Copilot, then AI_AGENT);
markers that IDEs also set in a person's own terminal are ignored. A new
"agent" property carries a name defined in code, never the variable's
value, and unknown AI_AGENT values become "unidentified_agent". Agent
wins the persona even in CI; ci and ci_provider stay as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tigh-latte tigh-latte changed the title feat(ENG-14331): label runs made by AI coding agents feat(ENG-15367): label runs made by AI coding agents Oct 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants